projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7959882
)
power: regulator: denied disable on always-on regulator
author
Patrick Delaunay
<
[email protected]
>
Thu, 15 Nov 2018 12:45:31 +0000
(13:45 +0100)
committer
Simon Glass
<
[email protected]
>
Wed, 5 Dec 2018 13:06:44 +0000
(06:06 -0700)
Don't disable regulator which are tagged as "regulator-always-on" in DT.
Signed-off-by: Patrick Delaunay <
[email protected]
>
Reviewed-by: Simon Glass <
[email protected]
>
Reviewed-by: Jack Mitchell <
[email protected]
>
Tested-by: Jack Mitchell <
[email protected]
>
Signed-off-by: Patrice Chotard <
[email protected]
>
Reviewed-by: Richard Röjfors <
[email protected]
>
Tested-by: Richard Röjfors <
[email protected]
>
Reviewed-by: Felix Brack <
[email protected]
>
Tested-by: Felix Brack <
[email protected]
>
drivers/power/regulator/regulator-uclass.c
patch
|
blob
|
history
diff --git
a/drivers/power/regulator/regulator-uclass.c
b/drivers/power/regulator/regulator-uclass.c
index 4da8e43259fc29bb43fa9073b374ed04cd6ba248..4511625ff25133330e4eeab96169c28b7113c671 100644
(file)
--- a/
drivers/power/regulator/regulator-uclass.c
+++ b/
drivers/power/regulator/regulator-uclass.c
@@
-106,10
+106,15
@@
int regulator_get_enable(struct udevice *dev)
int regulator_set_enable(struct udevice *dev, bool enable)
{
const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+ struct dm_regulator_uclass_platdata *uc_pdata;
if (!ops || !ops->set_enable)
return -ENOSYS;
+ uc_pdata = dev_get_uclass_platdata(dev);
+ if (!enable && uc_pdata->always_on)
+ return -EACCES;
+
return ops->set_enable(dev, enable);
}